package self.wargon.springcloudstu.userservice.controller;

import io.swagger.v3.oas.annotations.Operation;
import org.easydev.base.webbase.bo.JsonEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import self.wargon.springcloudstu.userservice.bo.UserInfo;

@RestController
@RequestMapping("/api/user")
public class UserController {

    @Operation(summary = "获取用户信息")
    @GetMapping("/info/username/{username}")
    public JsonEntity<UserInfo> getUserInfo(@PathVariable("username") String username) {
        UserInfo userInfo = new UserInfo();
        userInfo.setUsername(username);
        userInfo.setAlias("wargon");
        throw new RuntimeException("测试异常");
//        return JsonEntity.of(userInfo);
    }
}
